﻿using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace FlyingEye.Migrations
{
    /// <inheritdoc />
    public partial class FirstMigrations : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterDatabase()
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "AppComeGroupNotificationConfigurations",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    Secret = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    AccessToken = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    GroupName = table.Column<string>(type: "varchar(255)", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    UniqueHashKey = table.Column<string>(type: "varchar(255)", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    AgentId = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    TemplateId = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    AuthKey = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AppComeGroupNotificationConfigurations", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "AppComeUserNotificationConfigurations",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    Name = table.Column<string>(type: "varchar(255)", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    UniqueHashKey = table.Column<string>(type: "varchar(255)", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    AgentId = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    TemplateId = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    AuthKey = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AppComeUserNotificationConfigurations", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "AppComeUsers",
                columns: table => new
                {
                    Id = table.Column<string>(type: "varchar(255)", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    UserName = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AppComeUsers", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "AppProductionBases",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    SiteName = table.Column<string>(type: "varchar(255)", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AppProductionBases", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "AppProductionWorkshops",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    SiteId = table.Column<int>(type: "int", nullable: false),
                    WorkshopName = table.Column<string>(type: "varchar(255)", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AppProductionWorkshops", x => x.Id);
                    table.ForeignKey(
                        name: "FK_AppProductionWorkshops_AppProductionBases_SiteId",
                        column: x => x.SiteId,
                        principalTable: "AppProductionBases",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "AppProductionProcesses",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    ProductionWorkshopId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    ProcessName = table.Column<string>(type: "varchar(255)", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AppProductionProcesses", x => x.Id);
                    table.ForeignKey(
                        name: "FK_AppProductionProcesses_AppProductionWorkshops_ProductionWork~",
                        column: x => x.ProductionWorkshopId,
                        principalTable: "AppProductionWorkshops",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "AppDeviceHosts",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    ProductionProcessId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    DeviceHostName = table.Column<string>(type: "varchar(255)", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AppDeviceHosts", x => x.Id);
                    table.ForeignKey(
                        name: "FK_AppDeviceHosts_AppProductionProcesses_ProductionProcessId",
                        column: x => x.ProductionProcessId,
                        principalTable: "AppProductionProcesses",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "AppDeviceMaintenances",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    DeviceHostId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    DeviceName = table.Column<string>(type: "varchar(255)", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ComeGroupNotificationConfigurationId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    ComeUserNotificationConfigurationId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AppDeviceMaintenances", x => x.Id);
                    table.ForeignKey(
                        name: "FK_AppDeviceMaintenances_AppComeGroupNotificationConfigurations~",
                        column: x => x.ComeGroupNotificationConfigurationId,
                        principalTable: "AppComeGroupNotificationConfigurations",
                        principalColumn: "Id");
                    table.ForeignKey(
                        name: "FK_AppDeviceMaintenances_AppComeUserNotificationConfigurations_~",
                        column: x => x.ComeUserNotificationConfigurationId,
                        principalTable: "AppComeUserNotificationConfigurations",
                        principalColumn: "Id");
                    table.ForeignKey(
                        name: "FK_AppDeviceMaintenances_AppDeviceHosts_DeviceHostId",
                        column: x => x.DeviceHostId,
                        principalTable: "AppDeviceHosts",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "AppDeviceParts",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    DeviceMaintenanceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    DevicePartName = table.Column<string>(type: "varchar(255)", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    MaintenanceStatus = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CurrentLifetime = table.Column<int>(type: "int", nullable: false),
                    AccumulatedDowntime = table.Column<int>(type: "int", nullable: false),
                    EconomicLifetimeThreshold = table.Column<int>(type: "int", nullable: false),
                    CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AppDeviceParts", x => x.Id);
                    table.ForeignKey(
                        name: "FK_AppDeviceParts_AppDeviceMaintenances_DeviceMaintenanceId",
                        column: x => x.DeviceMaintenanceId,
                        principalTable: "AppDeviceMaintenances",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "AppMaintenanceMembers",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    DeviceMaintenanceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    ComeUserId = table.Column<string>(type: "varchar(255)", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    DeviceMaintenanceModelId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AppMaintenanceMembers", x => x.Id);
                    table.ForeignKey(
                        name: "FK_AppMaintenanceMembers_AppComeUsers_ComeUserId",
                        column: x => x.ComeUserId,
                        principalTable: "AppComeUsers",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_AppMaintenanceMembers_AppDeviceMaintenances_DeviceMaintenanc~",
                        column: x => x.DeviceMaintenanceId,
                        principalTable: "AppDeviceMaintenances",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_AppMaintenanceMembers_AppDeviceMaintenances_DeviceMaintenan~1",
                        column: x => x.DeviceMaintenanceModelId,
                        principalTable: "AppDeviceMaintenances",
                        principalColumn: "Id");
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "AppDevicePartCheckItems",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    DevicePartId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    Description = table.Column<string>(type: "varchar(255)", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AppDevicePartCheckItems", x => x.Id);
                    table.ForeignKey(
                        name: "FK_AppDevicePartCheckItems_AppDeviceParts_DevicePartId",
                        column: x => x.DevicePartId,
                        principalTable: "AppDeviceParts",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "AppMaintenanceRecords",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    DevicePartId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    MaintenanceStep = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    CancellationReason = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AppMaintenanceRecords", x => x.Id);
                    table.ForeignKey(
                        name: "FK_AppMaintenanceRecords_AppDeviceParts_DevicePartId",
                        column: x => x.DevicePartId,
                        principalTable: "AppDeviceParts",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateTable(
                name: "AppDevicePartCheckedResults",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    MaintenanceRecordId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    CheckItemId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    IsPassed = table.Column<bool>(type: "tinyint(1)", nullable: false),
                    CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AppDevicePartCheckedResults", x => x.Id);
                    table.ForeignKey(
                        name: "FK_AppDevicePartCheckedResults_AppDevicePartCheckItems_CheckIte~",
                        column: x => x.CheckItemId,
                        principalTable: "AppDevicePartCheckItems",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_AppDevicePartCheckedResults_AppMaintenanceRecords_Maintenanc~",
                        column: x => x.MaintenanceRecordId,
                        principalTable: "AppMaintenanceRecords",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                })
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.CreateIndex(
                name: "IX_AppComeGroupNotificationConfigurations_GroupName",
                table: "AppComeGroupNotificationConfigurations",
                column: "GroupName",
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_AppComeGroupNotificationConfigurations_UniqueHashKey",
                table: "AppComeGroupNotificationConfigurations",
                column: "UniqueHashKey",
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_AppComeUserNotificationConfigurations_Name",
                table: "AppComeUserNotificationConfigurations",
                column: "Name",
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_AppComeUserNotificationConfigurations_UniqueHashKey",
                table: "AppComeUserNotificationConfigurations",
                column: "UniqueHashKey",
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_AppDeviceHosts_ProductionProcessId_DeviceHostName",
                table: "AppDeviceHosts",
                columns: new[] { "ProductionProcessId", "DeviceHostName" });

            migrationBuilder.CreateIndex(
                name: "IX_AppDeviceMaintenances_ComeGroupNotificationConfigurationId",
                table: "AppDeviceMaintenances",
                column: "ComeGroupNotificationConfigurationId");

            migrationBuilder.CreateIndex(
                name: "IX_AppDeviceMaintenances_ComeUserNotificationConfigurationId",
                table: "AppDeviceMaintenances",
                column: "ComeUserNotificationConfigurationId");

            migrationBuilder.CreateIndex(
                name: "IX_AppDeviceMaintenances_DeviceHostId_DeviceName",
                table: "AppDeviceMaintenances",
                columns: new[] { "DeviceHostId", "DeviceName" },
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_AppDevicePartCheckedResults_CheckItemId",
                table: "AppDevicePartCheckedResults",
                column: "CheckItemId");

            migrationBuilder.CreateIndex(
                name: "IX_AppDevicePartCheckedResults_MaintenanceRecordId",
                table: "AppDevicePartCheckedResults",
                column: "MaintenanceRecordId");

            migrationBuilder.CreateIndex(
                name: "IX_AppDevicePartCheckItems_DevicePartId_Description",
                table: "AppDevicePartCheckItems",
                columns: new[] { "DevicePartId", "Description" },
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_AppDeviceParts_DeviceMaintenanceId",
                table: "AppDeviceParts",
                column: "DeviceMaintenanceId");

            migrationBuilder.CreateIndex(
                name: "IX_AppDeviceParts_DevicePartName_DeviceMaintenanceId",
                table: "AppDeviceParts",
                columns: new[] { "DevicePartName", "DeviceMaintenanceId" },
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_AppMaintenanceMembers_ComeUserId",
                table: "AppMaintenanceMembers",
                column: "ComeUserId");

            migrationBuilder.CreateIndex(
                name: "IX_AppMaintenanceMembers_DeviceMaintenanceId_ComeUserId",
                table: "AppMaintenanceMembers",
                columns: new[] { "DeviceMaintenanceId", "ComeUserId" },
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_AppMaintenanceMembers_DeviceMaintenanceModelId",
                table: "AppMaintenanceMembers",
                column: "DeviceMaintenanceModelId");

            migrationBuilder.CreateIndex(
                name: "IX_AppMaintenanceRecords_DevicePartId",
                table: "AppMaintenanceRecords",
                column: "DevicePartId");

            migrationBuilder.CreateIndex(
                name: "IX_AppProductionBases_SiteName",
                table: "AppProductionBases",
                column: "SiteName",
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_AppProductionProcesses_ProductionWorkshopId_ProcessName",
                table: "AppProductionProcesses",
                columns: new[] { "ProductionWorkshopId", "ProcessName" },
                unique: true);

            migrationBuilder.CreateIndex(
                name: "IX_AppProductionWorkshops_SiteId_WorkshopName",
                table: "AppProductionWorkshops",
                columns: new[] { "SiteId", "WorkshopName" },
                unique: true);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "AppDevicePartCheckedResults");

            migrationBuilder.DropTable(
                name: "AppMaintenanceMembers");

            migrationBuilder.DropTable(
                name: "AppDevicePartCheckItems");

            migrationBuilder.DropTable(
                name: "AppMaintenanceRecords");

            migrationBuilder.DropTable(
                name: "AppComeUsers");

            migrationBuilder.DropTable(
                name: "AppDeviceParts");

            migrationBuilder.DropTable(
                name: "AppDeviceMaintenances");

            migrationBuilder.DropTable(
                name: "AppComeGroupNotificationConfigurations");

            migrationBuilder.DropTable(
                name: "AppComeUserNotificationConfigurations");

            migrationBuilder.DropTable(
                name: "AppDeviceHosts");

            migrationBuilder.DropTable(
                name: "AppProductionProcesses");

            migrationBuilder.DropTable(
                name: "AppProductionWorkshops");

            migrationBuilder.DropTable(
                name: "AppProductionBases");
        }
    }
}
